/**
 * Created by meiguizhinian on 2018/7/16
 * Copyright © 2018 lixiaolong. All rights reserved.
 */

//对象 let obj = new ll.Obj(param)
(function () {
	//MulitLayerData
	ivy.MultiLayerData = function (param) {
		//成员变量
		this.mLayerIndex_ = 0;
		this.mLayerType_ = ivy.MultiLayerData.BuildExData.eNone;
		//地表层数据(2维 y,x)
		this.mLayerGroundData_ = [];//std::vector<std::vector<int16_t>>
		//建筑层数据 x,y坐标z标识id
		this.mLayerBuildData_ = [];//std::vector <cocos2d::Vec3>
		//当前层挂接属性
		this.mLayerProperties_ = {};//std::map<int32_t, int32_t>
		//建筑层额外数据
		this.mLayerExBuildData_ = {};//std::map<int32_t, BuildExData>
	};
	let p = ivy.MultiLayerData.prototype;
	////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
	p.isEmptyGroundLayer = function() {
		let vX = this.mLayerGroundData_.length;
		let vY = this.mLayerGroundData_[0].length;
		for (let i = 0; i < vX; ++i) {
			for(let j=0; j < vY; ++j) {
				if (this.mLayerGroundData_[i][j] >= 0)
					return false;
			}
		}
		return true;
	};
})();

(function () {
	ivy.MultiLayerData.BuildExData = function () {
		this.mKey = 0;
		this.mRotateValue = 0;
		this.mScaleX = 100;
		this.mScaleY = 100;
		this.mOffsetX = 0;
		this.mOffsetY = 0;
		this.mR = 255;
		this.mG = 255;
		this.mB = 255;
		this.mA = 255;
	};
})();

ivy.MultiLayerData.BuildExData.LayerType = {
	Ground  : 0,
	eBuild  : 1,
	eNone   : 2,
};